Sends raw byte data directly to the connected USB printer.
This method is intended for advanced use cases where printer-specific commands (e.g., ESC/POS commands, image data, or other proprietary command sequences) need to be sent to the printer. The caller is responsible for ensuring the data
byte array is correctly formatted according to the target printer's command language.
Compatibility Note: While designed with devices like the MASUNG MS-FPT301 in mind, compatibility with other USB printers depends on the printer's ability to interpret the raw data sent. The player does not perform any translation or formatting of this byte array.
It is recommended to consult the technical documentation for the specific printer model to understand its command set.
Parameters
A non-null byte array containing the raw command data to be sent to the printer. The content and structure of this array are printer-dependent.
See also
For a higher-level text printing method.
Throws
if data
is null.
Prints the given text to the connected USB printer, with an option to cut the paper.
This method provides a higher-level way to print plain text. The player will handle the conversion of the input string to a byte format suitable for the printer. The exact formatting capabilities (e.g., font styles, sizes, alignment) supported depend on the printer's default settings or any pre-configuration handled by the player's printing subsystem.
For complex layouts or direct control over printer commands, use print.
Parameters
The text string to be printed. Line breaks (e.g., "\n"
) should generally be respected and result in a new line on the printout. Must not be null
, though an empty string is acceptable.
If true
, a command to cut the paper will be sent after the text has been printed (if the printer supports this feature). If false
, the paper will not be cut by this command.
See also
For sending raw printer commands.
Throws
if text
is null.